package kr.hkit.powerjava.chapter11;

class Phone {
	String company;
	String dataType;
	int price;
	
	public Phone() {}
	
	public Phone(String company, String dataType, int price) {
		this.company = company;
		this.dataType = dataType;
		this.price = price;
	}

	public String getCompany() {
		return company;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	public String getdataType() {
		return dataType;
	}

	public void setdataType(String dataType) {
		this.dataType = dataType;
	}

	public int getPrice() {
		return price;
	}

	public void setPrice(int price) {
		this.price = price;
	}

	@Override
	public String toString() {
		return String.format("Phone [company=%s, type=%s, price=%s]", company,
				dataType, price);
	}
}

class SmartPhone extends Phone {
	String osType;
	String osVersion;
	int memory;
	boolean camara = true;
	boolean blutooth = true;
	
	public SmartPhone(String company, String dataType, int price,
			String osType, String osVersion, int memory, boolean camara,
			boolean blutooth) {
		super(company, dataType, price);
		this.osType = osType;
		this.osVersion = osVersion;
		this.memory = memory;
		this.camara = camara;
		this.blutooth = blutooth;
	}

	public String getOsType() {
		return osType;
	}

	public void setOsType(String osType) {
		this.osType = osType;
	}

	public String getOsVersion() {
		return osVersion;
	}

	public void setOsVersion(String osVersion) {
		this.osVersion = osVersion;
	}

	public int getMemory() {
		return memory;
	}

	public void setMemory(int memory) {
		this.memory = memory;
	}

	public boolean isCamara() {
		return camara;
	}

	public void setCamara(boolean camara) {
		this.camara = camara;
	}

	public boolean isBlutooth() {
		return blutooth;
	}

	public void setBlutooth(boolean blutooth) {
		this.blutooth = blutooth;
	}

	@Override
	public String toString() {
		return String
				.format("SmartPhone [osType=%s, osVersion=%s, memory=%s, camara=%s, blutooth=%s, company=%s, dataType=%s, price=%s]",
						osType, osVersion, memory, camara, blutooth, company,
						dataType, price);
	}
}

public class PhoneTest {
	public static void main(String[] args) {
		Phone p = new Phone();
		p.setCompany("LG");
		p.setdataType("4G");
		p.setPrice(140000);
		
		SmartPhone g2 = new SmartPhone(p.company, p.dataType, p.price, "android", "2.6", 16000, true, true);
		
		System.out.println(p);
		System.out.println(g2);
	}
}
